package com.faxsun.api.wrapper.customer;

import javax.servlet.http.HttpServletRequest;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.broadleafcommerce.profile.core.domain.Customer;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component("fsMergeCustomerWrapper")
@Scope("prototype")
@XmlRootElement(name = "fsMergeCustomer")
@XmlAccessorType(value = XmlAccessType.FIELD)
@XmlType(name = "fsMergeCustomerResource")
public class MergeCustomerWrapper extends CustomerWrapper {

	@XmlElement
	private int mergeCode;

	public void wrapBindMergedCustomer(Customer model, HttpServletRequest request, int code) {
		if (model != null) {
			super.wrapDetails(model, request);
		}
		this.mergeCode = code;
	}

}
